const request = axios.create({
    baseURL: 'http://localhost:8080/',
    timeout :5000
})

request.interceptors.response.use(
    response =>{
        let res = response.data;
        if(typeof res === 'string'){
            res = res ? JSON.parse(res) : res
        }
        return res
    },
    error =>{
        console.log('err' + error)
        return Promise.reject(error)
    }
)